Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Bump highlight.js from 10.0.3 to 10.5.0 #190

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dependabot-preview[bot]
Copy link
Contributor

Bumps highlight.js from 10.0.3 to 10.5.0. This update includes security fixes.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

ReDOS vulnerabities: multiple grammars

Impact: Potential ReDOS vulnerabilities (exponential and polynomial RegEx backtracking)

oswasp:

> The Regular expression Denial of Service (ReDoS) is a Denial of Service attack, that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression to enter these extreme situations and then hang for a very long time.

If are you are using Highlight.js to highlight user-provided data you are possibly vulnerable. On the client-side (in a browser or Electron environment) risks could include lengthy freezes or crashes... On the server-side infinite freezes could occur... effectively preventing users from accessing your app or service (ie, Denial of Service).

This is an issue with grammars shipped with the parser (and potentially 3rd party grammars also), not the parser itself. If you are using Highlight.js with any of the following grammars you are vulnerable. If you are using highlightAuto to detect the language (and have any of these grammars registered) you are vulnerable.

All versions prior to 10.4.1 are vulnerable, including version 9.18.5.

Grammars with exponential backtracking issues:

  • c-like (c, cpp, arduino)
  • handlebars (htmlbars)
  • gams
  • perl
  • jboss-cli
  • r

Affected versions: >= 9.0.0 < 10.4.1

Sourced from The GitHub Security Advisory Database.

Prototype Pollution in highlight.js

Impact

Affected versions of this package are vulnerable to Prototype Pollution. A malicious HTML code block can be crafted that will result in prototype pollution of the base object's prototype during highlighting. If you allow users to insert custom HTML code blocks into your page/app via parsing Markdown code blocks (or similar) and do not filter the language names the user can provide you may be vulnerable.

The pollution should just be harmless data but this can cause problems for applications not expecting these properties to exist and can result in strange behavior or application crashes, i.e. a potential DOS vector.

If your website or application does not render user provided data it should be unaffected.

Patches

Versions 9.18.2 and 10.1.2 and newer include fixes for this vulnerability. If you are using version 7 or 8 you are encouraged to upgrade to a newer release.

Workarounds

Patch your library

Manually patch your library to create null objects for both languages and aliases:

const HLJS = function(hljs) {
</tr></table> ... (truncated)
Affected versions: >= 10.0.0 < 10.1.2

Release notes

Sourced from highlight.js's releases.

10.5.0 - Holiday Cheer Edition

What's New

Build:

  • Add Subresource Integrity digest lists to cdn-assets [Josh Goebel][]
  • R and VB.net grammars now ship in our default build (:common) [Josh Goebel][]

Parser:

  • add match as sugar for simple begin only matches (#2834) [Josh Goebel][]
  • allow illegal to also be an array of regex (#2834) [Josh Goebel][]
  • add compilerExtensions allows grammers to influence mode compilation (#2834) [Josh Goebel][]
    • some internal pieces are now simple compiler extensions

New Languages:

  • Added 3rd party Red & Rebol grammar to SUPPORTED_LANGUAGES (#2872) [Oldes Huhuman][]

Language grammar improvements:

  • enh(cpp): Support C++ pack expansion in function arguments [Martin Dørum][]
  • enh(makefile): Add make as an alias (#2883) [tripleee][]
  • enh(swift) Improved grammar for strings (#2819) [Steven Van Impe][]
  • enh(swift) Grammar improvements (#2908) [Steven Van Impe][]
    • New grammar for keywords and built-ins
    • Added support for operator highlighting
    • New grammar for attributes
    • Added support for quoted identifiers, implicit parameters, and property wrapper projections
    • Support for more complex expressions in string interpolation
  • enh(swift) Improved highlighting for types and generic arguments (#2920) [Steven Van Impe][]
  • fix(http) avoid recursive sublanguage and tighten rules (#2893) [Josh Goebel][]
  • fix(asciidoc): Handle section titles level 5 (#2868) [Vaibhav Chanana][]
  • fix(asciidoc): Support unconstrained emphasis syntax (#2869) [Guillaume Grossetie][]
  • enh(scheme) Allow [] for argument lists (#2913) [Josh Goebel][]
  • enh(vb) Large rework of VB.net grammar (#2808) [Jan Pilzer][]
    • Adds support for Date data types, see (#2775)
    • Adds support for REM comments and fixes ''' doctags (#2875) (#2851)
      • Custom number mode to support VB.net specific number flags
      • Hex (&H), Oct (&O), and binary (&B) prefixes
      • Separating digits with underscores: 90_946
    • Type suffixes: 123UI (unsigned integer)
    • Improves directives detection and adds support for Enable, Disable, and Then keywords
    • Adds more markup tests
  • fix(javascript) Empty block-comments break highlighting (#2896) [Jan Pilzer][]
  • enh(dart) Fix empty block-comments from breaking highlighting (#2898) [Jan Pilzer][]
  • enh(dart) Fix empty doc-comment eating next line [Jan Pilzer][]
  • enh(asciidoc) Adds support for unconstrained bold syntax (#2869) [Guillaume Grossetie][]
  • enh(c-like) Incorrect highlighting for interger suffix (#2919) [Vaibhav Chanana][]
  • enh(properties) Correctly handle trailing backslash (#2922) [Vaibhav Chanana][]
Changelog

Sourced from highlight.js's changelog.

Version 10.5.0

Build:

  • Add Subresource Integrity digest lists to cdn-assets [Josh Goebel][]
  • R and VB.net grammars now ship in our default build (:common) [Josh Goebel][]

Parser:

  • add match as sugar for simple begin only matches (#2834) [Josh Goebel][]
  • allow illegal to also be an array of regex (#2834) [Josh Goebel][]
  • add compilerExtensions allows grammers to influence mode compilation (#2834) [Josh Goebel][]
    • some internal pieces are now simple compiler extensions

New Languages:

  • Added 3rd party Red & Rebol grammar to SUPPORTED_LANGUAGES (#2872) [Oldes Huhuman][]

Language grammar improvements:

  • enh(cpp): Support C++ pack expansion in function arguments [Martin Dørum][]
  • enh(makefile): Add make as an alias (#2883) [tripleee][]
  • enh(swift) Improved grammar for strings (#2819) [Steven Van Impe][]
  • enh(swift) Grammar improvements (#2908) [Steven Van Impe][]
    • New grammar for keywords and built-ins
    • Added support for operator highlighting
    • New grammar for attributes
    • Added support for quoted identifiers, implicit parameters, and property wrapper projections
    • Support for more complex expressions in string interpolation
  • enh(swift) Improved highlighting for types and generic arguments (#2920) [Steven Van Impe][]
  • fix(http) avoid recursive sublanguage and tighten rules (#2893) [Josh Goebel][]
  • fix(asciidoc): Handle section titles level 5 (#2868) [Vaibhav Chanana][]
  • fix(asciidoc): Support unconstrained emphasis syntax (#2869) [Guillaume Grossetie][]
  • enh(scheme) Allow [] for argument lists (#2913) [Josh Goebel][]
  • enh(vb) Large rework of VB.net grammar (#2808) [Jan Pilzer][]
    • Adds support for Date data types, see (#2775)
    • Adds support for REM comments and fixes ''' doctags (#2875) (#2851)
      • Custom number mode to support VB.net specific number flags
      • Hex (&H), Oct (&O), and binary (&B) prefixes
      • Separating digits with underscores: 90_946
    • Type suffixes: 123UI (unsigned integer)
    • Improves directives detection and adds support for Enable, Disable, and Then keywords
    • Adds more markup tests
  • fix(javascript) Empty block-comments break highlighting (#2896) [Jan Pilzer][]
  • enh(dart) Fix empty block-comments from breaking highlighting (#2898) [Jan Pilzer][]
  • enh(dart) Fix empty doc-comment eating next line [Jan Pilzer][]
  • enh(asciidoc) Adds support for unconstrained bold syntax (#2869) [Guillaume Grossetie][]
  • enh(c-like) Incorrect highlighting for interger suffix (#2919) [Vaibhav Chanana][]
  • enh(properties) Correctly handle trailing backslash (#2922) [Vaibhav Chanana][]
Commits
  • af20048 (chore) release to production
  • 3522147 (release) 10.5.0 holiday edition
  • 511aa11 (chore) update maintainers guide
  • ff34d49 (chore) remove ridiculous Crystal relevance
  • 3e0b520 (chore) lint Crystal
  • f863bce (chore) ship R and VB.net in :common
  • d64fbcd prepare for 10.5 release
  • 6c2ff21 (chore) camelCase lint
  • eaa1c42 (chore) bump terser
  • 82f7a68 (chore) clean up types a bit
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by highlightjs_bot, a new releaser for highlight.js since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability labels Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants